#include "AbstractFactoryMode.h"

void Rectangle::draw()
{
	cout << "Inside Rectangle::draw() method." << endl;
}

void Square::draw()
{
	cout << "Inside Square::draw() method." << endl;
}

void Circle::draw()
{
	cout << "Inside Circle::draw() method." << endl;
}

void Red::fill()
{
	cout << "Inside Red::fill() method." << endl;
}

void Green::fill()
{
	cout << "Inside Green::fill() method." << endl;
}

void Yellow::fill()
{
	cout << "Inside Yellow::fill() method." << endl;
}

Shape* ShapeFactory::getShape(string shape)
{
	if (shape == "circle")
	{
		return new Circle();
	}
	else if (shape == "rectangle")
	{
		return new Rectangle();
	}
	else if (shape == "square")
	{
		return new Square();
	}
	return nullptr;
}

Color* ShapeFactory::getColor(string color)
{
	return nullptr;
}

Shape* ColorFactory::getShape(string shape)
{
	return nullptr;
}

Color* ColorFactory::getColor(string color)
{
	if (color == "red")
	{
		return new Red();
	}
	else if (color == "green")
	{
		return new Green();
	}
	else if (color == "yellow")
	{
		return new Yellow();
	}
	return nullptr;
}

AbstractFactory* FactoryProducer::getFactory(string choice)
{
	if (choice == "shape")
	{
		return new ShapeFactory();
	}
	else if (choice == "color")
	{
		return new ColorFactory();
	}
	return nullptr;
}
